
{{ define "admin/focus/index.html" }}

{{ template "admin/common/page_header.html" .}}


<div class="container-fluid p-t-15">
    <div class="row">
        <div class="col-lg-12">
            <div class="card">
                <header class="card-header">
                    <a href="/admin/focus/add" class="btn btn-primary">增加轮播图</a>
                </header>
                <div class="card-body">
                    <table class="table table-hover table-dark">
                        <thead>
                        <tr class="th">
                            <th>轮播图名称</th>
                            <th>轮播图类型</th>
                            <th>轮播图图片</th>
                            <th>跳转地址</th>
                            <th class="text-center">排序</th>
                            <th class="text-center">状态</th>
                            <th class="text-center">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {{range $key,$value := .focusList}}
                            <tr>
                                <td>{{$value.Title}}</td>
                                <td>
                                    {{if eq $value.FocusType 1}}
                                        网站
                                    {{else if eq $value.FocusType 2}}
                                        APP
                                    {{else}}
                                        小程序
                                    {{end}}

                                </td>
                                <td>
                                    {{if ne $value.FocusImg ""}}
                                        <img class="rounded" src="{{$value.FocusImg | FormatImg}}" width="200"  />
                                    {{end}}
                                </td>
                                <td>{{$value.Link}}</td>
                                <td class="text-center">
                                    <span class="chSpanNum" data-id="{{$value.Id}}" data-table="focus" data-field="sort">{{$value.Sort}}</span>
                                </td>
                                <td align="center">
                                    {{if eq $value.Status 1}}
                                        <img class="rounded" data-id="{{$value.Id}}" data-table="focus" data-field="status" src="/static/admin/images/yes.gif" />
                                    {{else}}
                                        <img class="rounded"  data-id="{{$value.Id}}" data-table="focus" data-field="status" src="/static/admin/images/no.gif" />
                                    {{end}}
                                </td>
                                <td class="text-center">
                                    <a href="/admin/focus/edit?id={{$value.Id}}" />修改</a>
                                    <a class="delete" href="/admin/focus/delete?id={{$value.Id}}" />删除</a>
                                </td>
                            </tr>
                        {{end}}

                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>

{{end}}